<?php /* Smarty version 2.6.12, created on 2008-10-30 14:55:53
         compiled from modules/Gift_Certificates/gc_admin.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', 'modules/Gift_Certificates/gc_admin.tpl', 26, false),array('modifier', 'truncate', 'modules/Gift_Certificates/gc_admin.tpl', 144, false),array('modifier', 'date_format', 'modules/Gift_Certificates/gc_admin.tpl', 145, false),array('modifier', 'strip_tags', 'modules/Gift_Certificates/gc_admin.tpl', 148, false),array('function', 'cycle', 'modules/Gift_Certificates/gc_admin.tpl', 117, false),)), $this); ?>
<?php func_load_lang($this, "modules/Gift_Certificates/gc_admin.tpl","lbl_gift_certificates,txt_gc_admin_top_text,lbl_gc_print_warning,lbl_no_giftcert_selected,lbl_check_all,lbl_uncheck_all,lbl_order,lbl_giftcert_ID,lbl_gc_type,lbl_status,lbl_rem_amount,lbl_added,lbl_return,txt_not_available,lbl_email,lbl_mail,lbl_pending,lbl_active,lbl_blocked,lbl_disabled,lbl_expired,lbl_used,lbl_delete,lbl_update_all,txt_gc_update_warning,lbl_print_selected,txt_no_gc,lbl_add_new_,lbl_gift_certificates"); ?><?php if ($GLOBALS['HTTP_GET_VARS']['mode'] == 'add_gc' || ( $GLOBALS['HTTP_GET_VARS']['mode'] == 'modify_gc' && $this->_tpl_vars['gc_readonly'] != 'Y' )):  $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "modules/Gift_Certificates/giftcert.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
  elseif ($GLOBALS['HTTP_GET_VARS']['mode'] == 'modify_gc'):  $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "modules/Gift_Certificates/giftcert_static.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
  else: ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "page_title.tpl", 'smarty_include_vars' => array('title' => $this->_tpl_vars['lng']['lbl_gift_certificates'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<?php echo $this->_tpl_vars['lng']['txt_gc_admin_top_text']; ?>


<br /><br />

<?php ob_start(); ?>

<script type="text/javascript" language="JavaScript 1.2">
<!--

<?php echo '
function gc_change_all(flag) {
	checkAll(flag, document.gcform, \'gcids\');
	gc_selected();
}
'; ?>


var gc_print_warning = "<?php echo ((is_array($_tmp=$this->_tpl_vars['lng']['lbl_gc_print_warning'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
";
var lbl_no_giftcert_selected = "<?php echo ((is_array($_tmp=$this->_tpl_vars['lng']['lbl_no_giftcert_selected'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
";
var gc_templates = [];
<?php $_from = $this->_tpl_vars['giftcerts']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['v']):
 if ($this->_tpl_vars['v']['send_via'] != 'E'): ?>gc_templates['<?php echo $this->_tpl_vars['v']['gcid']; ?>
'] = '<?php echo $this->_tpl_vars['v']['tpl_file']; ?>
';
<?php endif;  endforeach; endif; unset($_from); ?>

-->
</script>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "main/include_js.tpl", 'smarty_include_vars' => array('src' => "change_all_checkboxes.js")));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<div style="line-height:170%"><a href="javascript:gc_change_all(true);"><?php echo $this->_tpl_vars['lng']['lbl_check_all']; ?>
</a> / <a href="javascript:gc_change_all(false);"><?php echo $this->_tpl_vars['lng']['lbl_uncheck_all']; ?>
</a></div>

<form name="gcform" action="giftcerts.php" method="post">
<input type="hidden" name="mode" value="" />
<input type="hidden" name="tpl_file" value="" />

<?php if ($this->_tpl_vars['giftcerts'] != ""): ?>

<?php echo '
<script type="text/javascript" language="JavaScript 1.2">
<!--
function gc2tpl() {
	var r = [];
	for (var gcid in gc_templates) {
		if (!document.gcform.elements[\'gcids[\'+gcid+\']\'].checked)
			continue;

		var tpl = gc_templates[gcid];
		if (!r[tpl])
			r[tpl] = [];
		r[tpl].push(gcid);
	}
	return r;
}

function gc_selected() {
	var gc_tpl = gc2tpl();
	var tpl_count = 0;

	for (var i in gc_tpl) {
		tpl_count++;
	}

	if (!document.getElementById(\'print_warn_box\'))
		return;

	if (tpl_count > 1) {
		document.getElementById(\'print_warn_box\').style.display = \'\';
		document.getElementById(\'print_warn_msg\').innerHTML = substitute(gc_print_warning, "num", tpl_count);
	} else {
		document.getElementById(\'print_warn_box\').style.display = \'none\';
	}
}

function gc_do_print() {
	var gc_tpl = gc2tpl();
	var found = false;
	
	for (var tpl in gc_tpl) {
		found = true;
		var url_arr = [];
		for (var i in gc_tpl[tpl]) {
			url_arr.push(\'gcids[\'+gc_tpl[tpl][i]+\']=on\');
		}
		window.open(\'giftcerts.php?mode=print&tpl_file=\' + tpl + \'&\' + url_arr.join(\'&\'));
	}

	if (!found)
		alert(lbl_no_giftcert_selected);
}
-->
</script>
'; ?>

<?php endif; ?>

<table cellpadding="3" cellspacing="1" width="100%">

<tr class="TableHead">
	<td width="5">&nbsp;</td>
	<td width="10%"><?php echo $this->_tpl_vars['lng']['lbl_order']; ?>
</td>
	<td width="25%"><?php echo $this->_tpl_vars['lng']['lbl_giftcert_ID']; ?>
</td>
	<td width="10%"><?php echo $this->_tpl_vars['lng']['lbl_gc_type']; ?>
</td>
	<td width="10%"><?php echo $this->_tpl_vars['lng']['lbl_status']; ?>
</td>
	<td width="25%" align="center"><?php echo $this->_tpl_vars['lng']['lbl_rem_amount']; ?>
</td>
	<td width="20%" align="center"><?php echo $this->_tpl_vars['lng']['lbl_added']; ?>
</td>
</tr>

<?php if ($this->_tpl_vars['giftcerts'] != ""): ?>

<?php unset($this->_sections['gc_num']);
$this->_sections['gc_num']['name'] = 'gc_num';
$this->_sections['gc_num']['loop'] = is_array($_loop=$this->_tpl_vars['giftcerts']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['gc_num']['show'] = true;
$this->_sections['gc_num']['max'] = $this->_sections['gc_num']['loop'];
$this->_sections['gc_num']['step'] = 1;
$this->_sections['gc_num']['start'] = $this->_sections['gc_num']['step'] > 0 ? 0 : $this->_sections['gc_num']['loop']-1;
if ($this->_sections['gc_num']['show']) {
    $this->_sections['gc_num']['total'] = $this->_sections['gc_num']['loop'];
    if ($this->_sections['gc_num']['total'] == 0)
        $this->_sections['gc_num']['show'] = false;
} else
    $this->_sections['gc_num']['total'] = 0;
if ($this->_sections['gc_num']['show']):

            for ($this->_sections['gc_num']['index'] = $this->_sections['gc_num']['start'], $this->_sections['gc_num']['iteration'] = 1;
                 $this->_sections['gc_num']['iteration'] <= $this->_sections['gc_num']['total'];
                 $this->_sections['gc_num']['index'] += $this->_sections['gc_num']['step'], $this->_sections['gc_num']['iteration']++):
$this->_sections['gc_num']['rownum'] = $this->_sections['gc_num']['iteration'];
$this->_sections['gc_num']['index_prev'] = $this->_sections['gc_num']['index'] - $this->_sections['gc_num']['step'];
$this->_sections['gc_num']['index_next'] = $this->_sections['gc_num']['index'] + $this->_sections['gc_num']['step'];
$this->_sections['gc_num']['first']      = ($this->_sections['gc_num']['iteration'] == 1);
$this->_sections['gc_num']['last']       = ($this->_sections['gc_num']['iteration'] == $this->_sections['gc_num']['total']);
?>
<tr<?php echo smarty_function_cycle(array('values' => ", class='TableSubHead'"), $this);?>
>
	<td width="5"><input type="checkbox"<?php if ($this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['send_via'] == 'E'): ?> disabled="disabled"<?php else: ?> name="gcids[<?php echo $this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['gcid']; ?>
]" onclick="javascript:gc_selected();"<?php endif; ?> /></td>
<?php if ($this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['orderid']): ?>
	<td><a href="order.php?orderid=<?php echo $this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['orderid']; ?>
">#<?php echo $this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['orderid']; ?>
</a></td>
<?php elseif ($this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['return'] != ''): ?>
	<td><?php echo $this->_tpl_vars['lng']['lbl_return']; ?>
 <a href="returns.php?mode=modify&amp;returnid=<?php echo $this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['return']['returnid']; ?>
">RMA#<?php echo $this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['return']['returnid']; ?>
</a></td>
<?php else: ?>
	<td><?php echo $this->_tpl_vars['lng']['txt_not_available']; ?>
</td>
<?php endif; ?>
	<td><a href="giftcerts.php?mode=modify_gc&amp;gcid=<?php echo $this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['gcid']; ?>
"><?php echo $this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['gcid']; ?>
</a></td>
	<td>
<?php if ($this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['send_via'] == 'E'):  echo $this->_tpl_vars['lng']['lbl_email'];  else:  echo $this->_tpl_vars['lng']['lbl_mail'];  endif; ?>
	</td>
	<td>
	<select name="status-<?php echo $this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['gcid']; ?>
">
		<option value="P"<?php if ($this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['status'] == 'P'): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lng']['lbl_pending']; ?>
</option>
		<option value="A"<?php if ($this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['status'] == 'A'): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lng']['lbl_active']; ?>
</option>
		<option value="B"<?php if ($this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['status'] == 'B'): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lng']['lbl_blocked']; ?>
</option>
		<option value="D"<?php if ($this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['status'] == 'D'): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lng']['lbl_disabled']; ?>
</option>
		<option value="E"<?php if ($this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['status'] == 'E'): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lng']['lbl_expired']; ?>
</option>
		<option value="U"<?php if ($this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['status'] == 'U'): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lng']['lbl_used']; ?>
</option>
	</select>
	</td>
	<td align="center" nowrap="nowrap">
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "currency.tpl", 'smarty_include_vars' => array('value' => $this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['debit'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>/<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "currency.tpl", 'smarty_include_vars' => array('value' => $this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['amount'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>  
	</td>
	<td align="center" nowrap="nowrap">
<?php if ($this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['orderid']): ?><a href="user_modify.php?user=<?php echo ((is_array($_tmp=$this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['login'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'url') : smarty_modifier_escape($_tmp, 'url')); ?>
&amp;usertype=<?php echo $this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['usertype']; ?>
"><?php echo ((is_array($_tmp=$this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['purchaser'])) ? $this->_run_mod_handler('truncate', true, $_tmp, '30', "...", true) : smarty_modifier_truncate($_tmp, '30', "...", true)); ?>
</a><?php else:  echo ((is_array($_tmp=$this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['purchaser'])) ? $this->_run_mod_handler('truncate', true, $_tmp, '30', "...", true) : smarty_modifier_truncate($_tmp, '30', "...", true));  endif; ?><br />
<font class="SmallText"><?php echo ((is_array($_tmp=$this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['add_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, $this->_tpl_vars['config']['Appearance']['datetime_format']) : smarty_modifier_date_format($_tmp, $this->_tpl_vars['config']['Appearance']['datetime_format'])); ?>
</font>
	</td>
<?php if ($this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['orderid'] == 0): ?>
	<td><input type="button" value="<?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['lng']['lbl_delete'])) ? $this->_run_mod_handler('strip_tags', true, $_tmp, false) : smarty_modifier_strip_tags($_tmp, false)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" onclick="javascript: self.location='giftcerts.php?mode=delete&amp;gcid=<?php echo $this->_tpl_vars['giftcerts'][$this->_sections['gc_num']['index']]['gcid']; ?>
';" /></td>
<?php endif; ?>
</tr>
<?php endfor; endif; ?>

<tr>
	<td colspan="7" class="SubmitBox">
<input type="submit" value="<?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['lng']['lbl_update_all'])) ? $this->_run_mod_handler('strip_tags', true, $_tmp, false) : smarty_modifier_strip_tags($_tmp, false)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" />
<br /><br />
<?php echo $this->_tpl_vars['lng']['txt_gc_update_warning']; ?>

	</td>
</tr>

<tr>
	<td colspan="7"><br />
<div style="display: none" id="print_warn_box">
<table cellspacing="0" cellpadding="2">
<tr>
	<td><img src="<?php echo $this->_tpl_vars['ImagesDir']; ?>
/log_type_Warning.gif" alt="" /></td>
	<td id="print_warn_msg"></td>
</tr>
</table>
<br />
</div>
<input type="button" value="<?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['lng']['lbl_print_selected'])) ? $this->_run_mod_handler('strip_tags', true, $_tmp, false) : smarty_modifier_strip_tags($_tmp, false)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" onclick="javascript: gc_do_print();" />
	</td>
</tr>

<?php else: ?>

<tr>
	<td colspan="7" align="center"><?php echo $this->_tpl_vars['lng']['txt_no_gc']; ?>
</td>
</tr>

<?php endif; ?>

<tr>
	<td colspan="7" class="SubmitBox">
	<input type="button" value="<?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['lng']['lbl_add_new_'])) ? $this->_run_mod_handler('strip_tags', true, $_tmp, false) : smarty_modifier_strip_tags($_tmp, false)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" onclick="javascript: self.location='giftcerts.php?mode=add_gc'" />
	</td>
</tr>

</table>
</form>

<?php $this->_smarty_vars['capture']['dialog'] = ob_get_contents(); ob_end_clean();  $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "dialog.tpl", 'smarty_include_vars' => array('title' => $this->_tpl_vars['lng']['lbl_gift_certificates'],'content' => $this->_smarty_vars['capture']['dialog'],'extra' => 'width="100%"')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
  endif; ?>